﻿// <copyright file="IKingManager.cs" company="Ecole Normale Supérieure">
// Released under GPLv2
// </copyright>
// <summary>Contains the interface IKingManager, an interface of king's operation.</summary>

namespace Sqwarea.GameLogic
{
    using System;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using Sqwarea.Persistence;

    /// <summary>
    /// Interface IKingMAnager, provider of king's operations.
    /// King or KingId must be set before any use of the class.
    /// </summary>
    public interface IKingManager
    {
        /// <summary>
        /// Gets or sets the id of the used king
        /// </summary>
        long KingId { get; set; }

        /// <summary>
        /// Gets or sets the used king
        /// </summary>
        King King { get; set; }

        /// <summary>
        /// This function moves the king and sets flags when possible. 
        /// A validity check of the movement should be performed.
        /// </summary>
        /// <param name="direction">Direction to which the king moves</param>
        /// <returns>Whether the movement is successful</returns>
        bool MoveKing(Direction direction);

        /// <summary>
        /// This function sends an attack when possible. 
        /// A validity check of the movement should be performed. 
        /// An object Attack should be pushed to a queue in order to perform the attack. 
        /// Details of the attack can be infered from the king provided.
        /// </summary>
        /// <param name="destination">Destination of this attack.</param>
        /// <param name="troops">Number of troops to send</param>
        /// <returns>Whether the attack is valid</returns>
        bool SendTroops(Point destination, int troops);

        /// <summary>
        /// This function takes in academy `number` troops located on the square of the king.
        /// </summary>
        /// <param name="number">The number of troops to take.</param>
        /// <returns>Whether the operation succeeded.</returns>
        bool TakeTroops(int number);
    }
}
